<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>员工管理 员工管理</title>
<link href="${rc.contextPath}/common/css/common/common.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="${rc.contextPath}/common/js/thickbox/jquery.js"></script>
<script type="text/javascript" src="${rc.contextPath}/common/js/config.js"></script>
<script type="text/javascript" src="${rc.contextPath}/common/js/thickbox/thickbox.js"></script>
<link rel="stylesheet" href="${rc.contextPath}/common/js/zTree/css/zTreeStyle/zTreeStyle.css" type="text/css"/>
<script type="text/javascript" src="${rc.contextPath}/common/js/zTree/js/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="${rc.contextPath}/common/js/zTree/js/jquery.ztree.core-3.5.js"></script>
<script type="text/javascript" src="${rc.contextPath}/common/js/zTree/js/jquery.ztree.excheck-3.5.js"></script>
<script type="text/javascript" src="${rc.contextPath}/common/js/zTree/js/jquery.ztree.exedit-3.5.js"></script>

<style type="text/css">
	.emp{border:solid 1px gray; width:700px; height:300px;display:none; z-index:101;position:absolute; background-color:#FFFFFF;}
	.emp .title{width:100%;height:20px;line-height:50px; border-top:solid 1px red;background-color:#b60613;top:0px;}
	#greyBackGround{background:#000000;width:100%; display:none; z-index:100; top:0px; left:0px; position:absolute;}
	
	.deptTree{border:solid 1px gray; width:700px; height:500px;display:none; z-index:101;position:absolute; background-color:#FFFFFF;}
	.deptTree .title{width:100%;height:20px;line-height:50px; border-top:solid 1px red;background-color:#b60613;top:0px;}
	#deptTreeBackGround{background:#000000;width:100%; display:none; z-index:100; top:0px; left:0px; position:absolute;}
</style>
<script type="text/javascript" src="${rc.contextPath}/common/js/main.js"></script>
<script type="text/javascript" src="${rc.contextPath}/common/js/authority/employee.js"></script>
<script type="text/javascript">
var zNodes=$deptJson;
</script>
</head>
<body>
<input type="hidden" id="rootPath" value="${rc.contextPath}"/>
<div class="main">
  <div class="position">
	   <div class="p_left">当前位置：员工管理> 员工管理</div>
	   <div class="p_right">
	    <dl><dt>姓名：</dt><dd>${currentUser.ename}</dd></dl>
	    <dl><dt>登录时间：</dt><dd><span id="nowDate"></span></dd></dl>
	  </div>
  </div>
  <!--可拖动 上部分-->
  <div class="topBox">
    <div class="mesCheck">
      <div class="title1"><strong>员工管理</strong></div>
      <div class="box2C">
    <!-- 查询 -->
    #if($shiro.hasPermission("员工条件查询"))
	<div style="padding-left: 10px;"  class="tableForm tab1"><br/>
	<form id="queryForm" action="${rc.contextPath}/authority/employee/getEmpList" method="post">
		<input id="pageNow" name="pageNow" type="hidden" />
	
		员工姓名：
		#if($!ename)
			<input id="empName" name="ename" value="$!ename"/>
		#else
			<input id="empName" name="ename" value="" maxlength="20"/>
		#end
		
	 	角色：
	 	#if($!roleId)
		<select id="roleId" name="roleId" style="width: 130px;">
			<option value="">---请选择---</option>
			#foreach( $role in $roleList)  
				#if($roleId==$role.id)
					<option selected="selected" value="$role.id">$role.name</option>
				#else
					<option value="$role.id">$role.name</option>
				#end
			#end
		</select>
		#else
		<select id="roleId" name="roleId" style="width: 130px;">
	  		<option value="">---请选择---</option>
			#foreach( $role in $roleList)  
			<option value="$role.id">$role.name</option>
			#end
		</select>
		#end
	 	

	 	所属部门：
 	    <input id="queryDeptId" name="deptId" type="hidden" value="$!dept.id"/>
     	<input id="queryTempDeptId" value="$!dept.dname"  readonly="readonly" value="$!dept.id"/>
	 	<a href="javaScript:queryDeptTree();"><img src="${rc.contextPath}/common/images/search.jpg" alt="" width="15px;" height="15px;" /></a>
<!-- 	 	#if($deptId)
	 	<select id="deptId" name="deptId" style="width: 130px;">
	  		<option value="">---请选择---</option>
			#foreach( $dept in $deptList)  
				#if($deptId==$dept.id)
					<option selected="selected" value="$dept.id">$dept.dname</option>
				#else
					<option value="$dept.id">$dept.dname</option>
				#end
			#end
		</select>
	 	#else
	 	<select id="deptId" name="deptId" style="width: 130px;">
	  		<option value="">---请选择---</option>
			#foreach( $dept in $deptList)  
			<option value="$dept.id">$dept.dname</option>
			#end
		</select>
	 	#end -->
		<input id="queryEmp" type="button" value="查询"/>&nbsp; &nbsp; 
		<input id="clean" type="button" value="清空"/>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;  &nbsp; &nbsp;     
		</form>
		<div><strong>员工列表</strong></div>
	</div>
	#end
	<!-- 列表 -->
	<div>
		<table class="tab2" cellpadding="0" align="center" width="100%">
		  	<tr align="center" >
		  		<th width="5%"><input id="selectAll" onchange="selectAll()" type="checkbox"></input></th>
		  		<th width="7%" >登录名</th>
		  		<th width="10%">员工姓名</th>
		  		<th width="10%" >所属部门</th>
		  		<th width="7%" >是否负责人</th>
		  		
		  		<th width="10%" >角色</th>
		  		<th width="10%">操作</th>
		  	</tr>
	  		#foreach( $emp in $pageView.records)
		  	<tr align="center" >
		  		<td>
		  			<input id="empId_$emp.empno" type="checkbox" value="$emp.empno" />
		  		</td>
		  		<td>#if($emp.loginName)$emp.loginName#end </td>
		  		<td>$emp.ename</td>
		  		<td>#if($emp.dname)$emp.dname#end</td>
		  		<td>
		  		#if(!$emp.isResponsible)
		  		否
		  		#elseif($emp.isResponsible==1)
		  		是
		  		#else
		  		否
		  		#end
		  		</td>
		  		
		  		<td>#if($emp.roleName)$emp.roleName#end </td>
		  		<td align="center">
		  		#if($shiro.hasPermission("员工角色修改"))#end
		  			<a href="javaScript:roleModify('$!emp.empno','$!emp.id','$!emp.rolId','$!emp.isResponsible','$!emp.dname');" style="text-decoration: underline;">角色修改<a/>  
		  		
<!-- 		  		&nbsp; &nbsp;
		  		#if($shiro.hasPermission("账户管理"))
		  			<a href="javaScript:accountMangment('$emp.empno');">账户管理<a/>  
		  		#end -->
		  		</td>
		    </tr>
	    	#end
		</table><br/>
		#if($shiro.hasPermission("批量角色修改"))
			<input id="bathUapteRole" type="button"  value="批量角色修改" style="margin-right: 20px;"/>
		#end
	</div>
	<!-- #BeginLibraryItem "/Library/page.lbi" -->
			#set($pageNow=$pageView.pageNow)
			#set($pageNext=$pageView.pageNow+1)
			#if($pageView.pageNow==1)
				 #set($pageBack=$pageView.pageNow)
			#else
				 #set($pageBack=$pageView.pageNow - 1)
			#end
		    #set($startRecord=($pageNow*$pageView.pageSize)-$pageView.pageSize+1)
		    #set($endRecord=($pageNow*$pageView.pageSize))
    <input type="hidden" value="${pageView.pageCount}" id="pageCount"/>
    <div class="page clearfix">
      <ul class="le">
	        <li>显示<span>${startRecord}-${endRecord}</span>条</li>
	        <li>共<span>${pageView.rowCount}</span>条</li>
	        <li>第&nbsp;<span>${pageView.pageNow}</span>&nbsp;页</li>
      </ul>
      <ul class="ri">
        <li><a href="javascript:;configPageController('jump')" class="go">&nbsp;</a></li>
        <li>到
          <input type="text" class="input" id="pageJump" size="4" />
          页</li>
        <li><a href="javascript:;configPageController('${pageView.pageCount}')" class="btn">[末页]</a></li>
        <li><a href="javascript:;configPageController('${pageNext}')" class="btn">[下页]</a></li>
        <li><a href="javascript:;configPageController('${pageBack}')" class="btn">[前页]</a></li>
        <li><a href="javascript:;configPageController('1')" class="btn">[首页]</a></li>
      </ul>
    </div>
    <!-- #EndLibraryItem -->
	      		 
	<script>
	//分页
	function configPageController(value) {
		var pageCount=$("#pageCount").val();
		if(value<1){
			value=1;
		}
		if(value=="jump"){
			value=$("#pageJump").val();
		}
		if(parseInt(value)>parseInt(pageCount)){
			value=pageCount;
		}
		if(!$isQuery){
			window.location="${rc.contextPath}/authority/employee/empPage?pageNow="+value;
		}else{
			$("#pageNow")[0].value=value;
			$("#queryForm").submit();
		}	
	}
	</script>
	<br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
  
      
	<div id="updateAccount" class="emp" style="width: 500px;height: 230px;">
	   	<div class="title"></div><br/>
	   	<div style="margin-left: 20px;">修改账号</div> <br/>
	   	<div style="margin-left: 20px;">
	   		<input id="empno" name="empno" type="hidden" />
			用户名：<input id="loginName" name="loginName" maxlength="20" />
			密码:<input id="password" name="password" />
			<br/><br/>
			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			<input id="updateAccountAppBtn" type="button" value="应用"/>
			<input id="updateAccountBtnCancel" type="button" value="取消" />
		</div>   
	</div>

	<div id="updateRole" class="emp" style="width: 500px;height: 230px;">
	   	<div class="title"></div><br/>
	   	<div style="margin-left: 20px;">角色修改</div> <br/>
	   	<div style="margin-left: 20px;">
	   		<input id="updateRoleEmpno" name="empno" type="hidden" />
			所属部门：
<!-- 			<select id="updateRoleDeptId" name="deptId" style="width: 130px;">
	  			<option value="">---请选择---</option>
			#foreach( $dept in $deptList)  
				<option value="$dept.id">$dept.dname</option>
			#end
	  		</select> -->
	  		
	  	<input id=updateRoleDeptId name="deptId" type="hidden" value="$!dept.id"/>
     	<input id="roleModifyQueryTempDeptId" value="$!dept.dname"  readonly="readonly"/>
	 	<a href="javaScript:roleModifyQueryDeptTree();"><img src="${rc.contextPath}/common/images/search.jpg" alt="" width="15px;" height="15px;" /></a>
	  		
	  		
	  		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			<input id="isResponsible" name="isResponsible" type="checkbox" />&nbsp;部门负责人<br/><br/>
			所属角色:
			<select id="updateRoleRoleId" name="roleId" style="width: 130px;">
	  			<option value="">---请选择---</option>
				#foreach( $role in $roleList)  
					<option value="$role.id">$role.name</option>
				#end
			</select>
			<br/><br/>
			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			<input id="updateRoleAppBtn" type="button" value="应用"/>
			<input id="updateRoleBtnCancel" type="button" value="取消" />
		</div>   
	</div>

	<div id="bathUpdateRole" class="emp" style="width: 500px;height: 230px;">
	   	<div class="title"></div><br/>
	   	<div style="margin-left: 20px;">批量角色修改</div> <br/>
	   	<div style="margin-left: 20px;">
	   		<input id="bathUpdateRoleEmpno" name="empnoStr" type="hidden" />
			所属部门：
		<input id="bathUpdateRoleDeptId" name="deptId" type="hidden" value="$!dept.id"/>
     	<input id="bathQueryTempDeptId" value="$!dept.dname"  readonly="readonly"/>
	 	<a href="javaScript:bathQueryDeptTree();"><img src="${rc.contextPath}/common/images/search.jpg" alt="" width="15px;" height="15px;" /></a>
<!-- 			<select id="bathUpdateRoleDeptId" name="deptId" style="width: 130px;">
	  			<option value="">---请选择---</option>
			#foreach( $dept in $deptList)  
				<option value="$dept.id">$dept.dname</option>
			#end
	  		</select> -->
	  		
	  		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			<input id="bathUpdateRoleIsResponsible" name="isResponsible" type="checkbox" />&nbsp;部门负责人<br/><br/>
			所属角色:
			<select id="bathUpdateRoleRoleId" name="roleId" style="width: 130px;">
	  			<option value="">---请选择---</option>
				#foreach( $role in $roleList)  
					<option value="$role.id">$role.name</option>
				#end
			</select>
			<br/><br/>
			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
			<input id="bathUpdateRoleAppBtn" type="button" value="应用"/>
			<input id="bathUpdateRoleBtnCancel" type="button" value="取消" />
		</div>   
	</div>
</div>
</div>
</div>


<div id="deptTree" class="deptTree" style="width: 800px;height: 400px;">
	<div class="title"></div><br/>
	<div style="margin-left: 20px;">选择部门
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		<input id="deptTreeBtnCancel" type="button"  value="取消" style="float: right;margin-right: 10px;"/>
		<input id="queryDeptTreeBtnConfirm" type="button"  value="确定" style="float: right;margin-right: 10px;" />&nbsp;&nbsp;
	</div>
	<div style="margin-left: 20px;overflow-x: auto; overflow-y: auto;float: left;" class="zTreeDemoBackground left" >
		<ul id="treeDemo" class="ztree" style="width: 650px;height: 250px;"></ul>
	</div>
</div>


<div id="roleModifyDeptTree" class="deptTree" style="width: 800px;height: 400px;">
	<div class="title"></div><br/>
	<div style="margin-left: 20px;">选择部门
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		<input id="roleModifyDeptTreeBtnCancel" type="button"  value="取消" style="float: right;margin-right: 10px;"/>
		<input id="roleModifyQueryDeptTreeBtnConfirm" type="button"  value="确定" style="float: right;margin-right: 10px;" />&nbsp;&nbsp;
	</div>
	<div style="margin-left: 20px;overflow-x: auto; overflow-y: auto;float: left;" class="zTreeDemoBackground left" >
		<ul id="roleModifyDeptTreeDemo" class="ztree"  style="width: 650px;height: 250px;"></ul>
	</div>
</div>


<div id="bathDeptTree" class="deptTree" style="width: 800px;height: 400px;">
	<div class="title"></div><br/>
	<div style="margin-left: 20px;">选择部门
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
		<input id="bathDeptTreeBtnCancel" type="button"  value="取消" style="float: right;margin-right: 10px;"/>
		<input id="bathQueryDeptTreeBtnConfirm" type="button"  value="确定" style="float: right;margin-right: 10px;" />&nbsp;&nbsp;
	</div>
	<div style="margin-left: 20px;overflow-x: auto; overflow-y: auto;float: left;" class="zTreeDemoBackground left" >
		<ul id="bathDeptTreeDemo" class="ztree"  style="width: 650px;height: 250px;"></ul>
	</div>
</div>

</div>
</body>
</html>
